{extend name="default/base/base_seller" /}
{block name="seller_main"}

<form method="get" action="">
    <input type="hidden" name="lock" value="{$Request.param.lock}" />
    <table class="search-form">
        <tr>
            <td style="width: 1px;"></td>
            <td>&nbsp;</td><th>{$Think.lang.return_order_add_time}</th>
            <td class="w240">
                <input type="text" class="text w70" name="add_time_from" id="add_time_from" value="{$Request.param.add_time_from}" />
                <label class="add-on"><i class="iconfont">&#xe8d6;</i></label>&nbsp;&#8211;&nbsp;
                <input id="add_time_to" type="text" class="text w70"  name="add_time_to" value="{$Request.param.add_time_to}" />
                <label class="add-on"><i class="iconfont">&#xe8d6;</i></label>
            </td>
            <th class="w60">{$Think.lang.processing_state}</th>
            <td class="w80">
                <select name="state">
                    <option value="" {if condition="$Request.param.state eq ''"}selected{/if}>{$Think.lang.ds_all}</option>
                    <option value="1" {if condition="$Request.param.state eq '1'"}selected{/if}>{$Think.lang.refund_state_confirm}</option>
                    <option value="2" {if condition="$Request.param.state eq '2'"}selected{/if}>{$Think.lang.refund_state_yes}</option>
                    <option value="3" {if condition="$Request.param.state eq '3'"}selected{/if}>{$Think.lang.refund_state_no}</option>
                </select>
            </td>
            <th class="w120">
                <select name="type">
                    <option value="order_sn" {if condition="$Request.param.type eq 'order_sn'"}selected{/if}>{$Think.lang.return_order_ordersn}</option>
                    <option value="return_sn" {if condition="$Request.param.type eq 'return_sn'"}selected{/if}>{$Think.lang.return_order_returnsn}</option>
                    <option value="buyer_name"{if condition="$Request.param.type eq 'buyer_name'"}selected{/if}>{$Think.lang.return_order_buyer}</option>
                </select>
            </th>
            <td class="w160" ><input type="text" class="text" name="keyword" value="{$Request.get.keyword}" /></td>
            <td class="w70 " style="width: 760px !important;"><input type="submit" class="submit" value="{$Think.lang.ds_search}" /></td>
        </tr>
    </table>
</form>
<table class="dssc-default-table">
    <thead>
    <tr ds_type="table_header">
        <th class="w30"></th>
        <th class="w100">商品/编号</th>
        <th class="w180">退款金额</th>
        <th class="w180">退款数量</th>
        <th class="w180">买家会员名</th>
        <th class="w180">类型</th>
        <th class="w180">申请时间</th>
        <th class="w180">商家处理状态</th>
        <th class="w180">处理状态</th>
        <th class="w180">平台确认</th>
        <th class="w150">{$Think.lang.ds_handle}</th>
    </tr>
    </thead>
    <tbody>
    {notempty name="return_list"}
    {foreach name="return_list" item="val" }
    <tr>
        <th colspan="20">&nbsp;&nbsp;订单号:{$val.order_sn}</th>
    </tr>
    <tr>
        <td>
            <div class="pic-thumb"><img src="{:goods_thumb($val, 240)}"/></div>
        </td>
        <td class="tl" title="{$val.store_name}">
                <dl class="goods-name" style="width: 158px;">
                    <dt><a style="margin-left: 24px;">{$val.goods_name}</a></dt>
                    <dd style="margin-left: 33px;">编号{$Think.lang.ds_colon}{$val.refund_sn}</dd>
                </dl>
        </td>
        <td>{$Think.lang.currency}{$val.refund_amount}</td>
        <td>{if $val.return_type == 2}{$val.goods_num}{else/}{$Think.lang.there_no}{/if}</td>
        <td>{$val.buyer_name}</td>
        <td>{$type_array[$val['refund_type']]}</td>
        <td>{$val.add_time|date="Y-m-d H:i:s",###}</td>
        <td>{$state_array[$val['seller_state']]}</td>
        <td>
            {if $val.seller_state == 2 && $val.refund_state >= 2}
               {$supply_array[$val['goods_state']]}
            {else/}
               无
            {/if}
        </td>
        <td>
            {if $val.seller_state == 2 && $val.refund_state >= 2 && $val.goods_state == 4}
               {if $val.refund_type == 2}
                   {$admin_array[$val['refund_state']]}
               {else/}
                   {$Think.lang.there_no}
                {/if}
            {else/}
                {$Think.lang.there_no}
            {/if}
            <!-- {if $val.seller_state == 2 && $val.refund_state >= 2}
               {$admin_array[$val['refund_state']]}
            {else/}
               {$Think.lang.there_no}
            {/if} -->
        </td>
        <td class="dscs-table-handle">
            <!-- {if $val.seller_state == 1} -->
            <!-- 审核 -->
            <!-- <span><a href="{:url('Sellerreview/edit',['return_id'=>$val.refund_id])}" class="btn-blue"><i class="iconfont">&#xe731;</i><p>审核</p></a></span> -->
            <!-- {else /} -->
            <!-- 查看详情 -->
            <!-- <span> <a href="{:url('Sellerreview/view',['return_id'=>$val.refund_id])}" class="btn-orange"><i class="iconfont">&#xe70b;</i><p>{$Think.lang.ds_view}</p></a></span> -->
            <!-- {/if} -->

            <!-- 收货 -->
            <!-- {if $val.seller_state == 2 && $val.return_type == 2 && $val.goods_state == 2} -->
 <!-- 查看详情 -->
            <span> <a href="{:url('Sellerreturn/view',['return_id'=>$val.refund_id])}" class="btn-orange"><i class="iconfont">&#xe70b;</i><p>{$Think.lang.ds_view}</p></a></span>
            {if $val.seller_state == 2 && $val.return_type == 2 && $val.aigin_deliver == 0 && $val.goods_state == 2 && $val.invoice_no != ''}
            <span><a href="javascript:void(0)" class="btn-green" ds_type="dialog" dialog_title="{$Think.lang.ds_edit}" dialog_id="return_order" dialog_width="480" uri="{:url('Sellerreturn/receive',['return_id'=>$val.refund_id])}"><i class="iconfont">&#xe6e9;</i><p>确认收货</p></a></span>
            {/if}

            {if $val.refund_type == 3 && $val.goods_state == 4}
            <span><a href="javascript:void(0)" class="btn-green" ds_type="dialog" dialog_title="{$Think.lang.ds_edit}" dialog_id="return_order" dialog_width="480" uri="{:url('Sellerreturn/aigin',['return_id'=>$val.refund_id])}"><i class="iconfont">&#xe6e9;</i><p>再次发货</p></a></span>
            {/if}
            <!-- {if $val.seller_state == 2 && $val.return_type == 2 && $val.refund_type == 3}
            <span><a href="javascript:void(0)" class="btn-green" ds_type="dialog" dialog_title="{$Think.lang.ds_edit}" dialog_id="return_order" dialog_width="480" uri="{:url('Sellerreview/receive',['return_id'=>$val.refund_id])}"><i class="iconfont">&#xe6e9;</i><p>再次发货</p></a></span>
            {/if} -->
        </td>
    </tr>
    <tr style="display:none;">
        <td colspan="7"><div class="dssc-goods-sku ps-container"></div></td>
    </tr>
    {/foreach}
    {else /}
    <tr>
        <td colspan="7" class="norecord"><div class="warning-option"><i class="iconfont">&#xe64c;</i><span>{$Think.lang.no_record}</span></div></td>
    </tr>
    {/notempty}
    </tbody>
        <tfoot>
        {notempty name="return_list"}
        <tr>
            <td colspan="20"><div class="pagination">{$show_page}</div></td>
        </tr>
        {/notempty}
    </tfoot>
</table>
<!-- <table class="dssc-default-table">
    <thead>
        <tr>
            <th class="w10"></th>
            <th colspan="2">{$Think.lang.merchandise_order_refund}</th>
            <th class="w70">{$Think.lang.refund_order_refund}</th>
            <th class="w70">{$Think.lang.return_order_return}</th>
            <th class="w90">{$Think.lang.refund_order_buyer}</th>
            <th class="w120">{$Think.lang.refund_order_add_time}</th>
            <th class="w60">{$Think.lang.processing_state}</th>
            <th class="w60">{$Think.lang.platform_confirm}</th>
            <th>{$Think.lang.ds_handle}</th>
        </tr>
    </thead>
    
    <tbody>
        {notempty name="return_list"}
        {foreach name="return_list" item="val" key="key" }
        <tr class="bd-line" >
            <td></td>
            <td class="w50">
                <div class="pic-thumb">
                    <a>
                        <img src="{:goods_thumb($val, 240)}" />
                    </a>
                </div>
            </td>
            <td class="tl" title="{$val.store_name}">
                <dl class="goods-name">
                    <dt><a href="{:url('Goods/index',['goods_id'=>$val.goods_id])}" target="_blank">{$val.goods_name}</a></dt>
                    <dd>{$Think.lang.refund_order_ordersn}{$Think.lang.ds_colon}<a href="{:url('Sellerorder/show_order',['order_id'=>$val.order_id])}" target="_blank">{$val.order_sn}</a></dd>
                    <dd>{$Think.lang.return_order_returnsn}{$Think.lang.ds_colon}{$val.refund_sn}</dd>
                </dl>
            </td>
            <td>{$Think.lang.currency}{$val.refund_amount}</td>
            <td>{if $val.return_type == 2}{$val.goods_num}{else/}{$Think.lang.there_no}{/if}</td>
            <td>{$val.buyer_name}</td>
            <td>{$val.add_time|date="Y-m-d H:i:s",###}</td>
            <td>{$state_array[$val['seller_state']]}</td>
            <td>{if $val.seller_state == 2 && $val.refund_state >= 2}{$admin_array[$val['refund_state']]}{else/}{$Think.lang.there_no}{/if}</td>
            <td class="dscs-table-handle">
                {if $val.seller_state == 1}
                <span><a href="{:url('Sellerreturn/edit',['return_id'=>$val.refund_id])}" class="btn-blue"><i class="iconfont">&#xe731;</i><p>{$Think.lang.deal_with}</p></a></span>
                {else /}
                <span> <a href="{:url('Sellerreturn/view',['return_id'=>$val.refund_id])}" class="btn-orange"><i class="iconfont">&#xe70b;</i><p>{$Think.lang.ds_view}</p></a></span>
                {/if}
                {if $val.seller_state == 2 && $val.return_type == 2 && $val.goods_state == 2}
                <span><a href="javascript:void(0)" class="btn-green" ds_type="dialog" dialog_title="{$Think.lang.ds_edit}" dialog_id="return_order" dialog_width="480" uri="{:url('Sellerreturn/receive',['return_id'=>$val.refund_id])}"><i class="iconfont">&#xe6e9;</i><p>{$Think.lang.goods_receipt}</p></a></span>
                {/if}
            </td>
        </tr>
        {/foreach}
        {else /}
        <tr>
            <td colspan="20" class="norecord"><div class="warning-option"><i class="iconfont">&#xe64c;&nbsp;</i><span>{$Think.lang.no_record}</span></div></td>
        </tr>
        {/notempty}
    </tbody>
    <tfoot>
        {notempty name="return_list"}
        <tr>
            <td colspan="20"><div class="pagination">{$show_page}</div></td>
        </tr>
        {/notempty}
    </tfoot>
</table> -->
<script>
    $(function () {
        $('#add_time_from').datepicker({dateFormat: 'yy-mm-dd'});
        $('#add_time_to').datepicker({dateFormat: 'yy-mm-dd'});
    });
    $((function($){

            $.datepicker.regional['zh-CN'] = {

                clearText: '清除',

                clearStatus: '清除已选日期',

                closeText: '关闭',

                closeStatus: '不改变当前选择',

                prevText: '<上月',

                prevStatus: '显示上月',

                prevBigText: '<<',

                prevBigStatus: '显示上一年',

                nextText: '下月>',

                nextStatus: '显示下月',

                nextBigText: '>>',

                nextBigStatus: '显示下一年',

                currentText: '今天',

                currentStatus: '显示本月',

                monthNames: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'],

                monthNamesShort: ['一','二','三','四','五','六', '七','八','九','十','十一','十二'],

                monthStatus: '选择月份',

                yearStatus: '选择年份',

                weekHeader: '周',

                weekStatus: '年内周次',

                dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],

                dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],

                dayNamesMin: ['日','一','二','三','四','五','六'],

                dayStatus: '设置 DD 为一周起始',

                dateStatus: '选择 m月 d日, DD',

                dateFormat: 'yy-mm-dd',

                firstDay: 1,

                initStatus: '请选择日期',

                showMonthAfterYear:true,//是否把月放在年的后面  

                yearSuffix: '年', //年的后缀  

                isRTL: false

                  };

            $.datepicker.setDefaults($.datepicker.regional['zh-CN']);

        })(jQuery));
</script>


{/block}
